﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BuildingDrawer
{
    class E_Plat:E_Element
    {
        #region variable

        public List<int> PidArray;
        public List<E_Point> NodeArray;
        public int nodeSize;
        #endregion

        #region function
        public E_Plat()
        {
            this.id=0;
            PidArray = null;
            NodeArray = null;
            nodeSize = 0;
            type = 2;
        }

        public E_Plat(int idIn, List<E_Point> NodeArrayIn)
        {
            PidArray = new List<int>();
            
            this.id = idIn;
            //NodeArray = NodeArrayIn;                   不知道有什么区别  会在函数退出后删除数据吗
            NodeArray = new List<E_Point>(NodeArrayIn);
            foreach (E_Point p in NodeArray)
            {
                PidArray.Add(p.id);
            }
            nodeSize = PidArray.Count;
            type = 2;
        }

        public override Boolean isEqual(E_Element in_element)
        {
            E_Plat in_plat = (E_Plat)in_element;
            if ((id != in_plat.id)||(nodeSize!=in_plat.nodeSize))
            {
                return false;
            }
            for (int i = 0; i < nodeSize; i++)
            {
                if (PidArray[i] != in_plat.PidArray[i])
                {
                    return false;
                }
            }
            return true;
        }

    


        #endregion
    }
}
